#!/usr/bin/env python
#  This file is part of FlickFleck.
#  Copyright 2008 by Jyke Tapani Jokinen
#
#    FlickFleck is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    FlickFleck is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with FlickFleck.  If not, see <http://www.gnu.org/licenses/>.
#
import sys, os, os.path
import Tkinter
import config
import configuration
import engine
import ui
import i18n

def main():
	configuration.init()
	i18n.init()
	ui.init()
	ui.wins.engine.init()
	ui.start()

if __name__=='__main__':
	# Get the directory where this program is and add that to the
	# module search-path.
	try:
        # XXX does any of these raise exceptions?
		basepath = os.path.dirname( os.path.abspath( sys.argv[0] ) )
		sys.path.append( basepath )
		os.chdir( basepath )
		config.installdir = basepath
		main()
	#
	# all error handling should be done in modules below
	# so we wont report anything here:
	except KeyboardInterrupt: 
			pass
